//Accepted
#include <cstdio>

int t, n, a, d, i, sum;
int  main(){
	//freopen("in.txt","r",stdin);//freopen("out.txt","w",stdout);
	scanf("%d", &t);
	while(t--){
		scanf("%d%d%d", &n, &a, &d);
		for(sum=i=0;i<n;++i)sum+=d*i+a;
		printf("%d\n", sum);
	}
    return 0;
}
